use "PRQ replication file.dta",clear

** Table 2 **
logit voted2 blackcand if ideo5!=. & pid7!=. & mobilized!=. & open!=. & total_spend!=. & income!=. & age_dec!=. & college!=. & female!=. & closeness2!=.,cl(cluster)
lroc,nog
logit voted2 blackcand  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5,cl(cluster)
lroc,nog

** Table 3 **
logit voted2 i.classify if ideo5!=. & pid7!=. & mobilized!=. & open!=. & total_spend!=. & income!=. & age_dec!=. & college!=. & female!=. & closeness2!=.,cl(cluster)
lroc,nog
logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5,cl(cluster)
lroc,nog
margins,at(classify=(0 1 2 3) mobilized=1 open=0 total_spend=26.08 income=7 age=4.6 college=0 female=1 close=-1.75 ideo=3 pid=2) vsquish atmeans


** Table 4 **

logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if pid7>3,cl(cluster)
lroc,nog
logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if pid7<4,cl(cluster)
lroc,nog

logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if close>-2,cl(cluster)
lroc,nog
logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if close<=-2,cl(cluster)
lroc,nog

logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if blackdeminc==1,cl(cluster)
lroc,nog
logit voted2 i.classify  pid7 mobilized open total_spend income age_dec college female closeness2 ideo5 if open==1 & blackdem==1,cl(cluster)
lroc,nog
